#include "include/Condition.hpp"

Condition::Condition(){
    pthread_cond_init(&_cond,nullptr);
}

Condition::~Condition(){
    pthread_cond_destroy(&_cond);
}

void Condition::wait(MutexLock & _mutex){
    pthread_cond_wait(&_cond,_mutex.getMutex());
}

void Condition::notify_one(){
    pthread_cond_signal(&_cond);
}

void Condition::notify_all(){
    pthread_cond_broadcast(&_cond);
}

